package com.markerhub.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.markerhub.entity.Tick;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 深林中的书海
 * @since 2021-12-16
 */
public interface TickMapper extends BaseMapper<Tick> {

    @Select("select * from m_tick where id  in (select MIN(id)from m_tick GROUP BY title)")
    List<Tick> getTickMsgToName(Page<Tick> page);
    //%${确定内容}%//$淘汰写法：直接注入 #需要申明类型
    @Select("select * from m_tick where id   in (select MIN(id)from m_tick  WHERE title LIKE '%${title}%' or description like '%${title}%' GROUP BY title) ")
    List<Tick> findTickMsg(Page<Tick> page,@Param("title") String title);

}
